<template>
  <div>
    Staff
    <ul @click="btnClick">
      <li>
        <router-link :to="{ path: '/staff/staffDetail/1/2' }">1</router-link>
      </li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
      <li>5</li>
    </ul>
    <el-button @click="btnClick2">跳转到about</el-button>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from "vue-router";
import { reactive } from "vue";
let router = useRouter();
const state = reactive({
  count: 0,
});
let btnClick = (event) => {
  router.push({
    name: "staffDetail",
    params: { id: 2, type: 3 },
    hash: "#staff",
  });
};
let  btnClick2 = async () => {
  var flag = await router.push({ name: "about1" });
  if (flag) {
    alert('失败')
  } else {
     alert('成功')
  }
};
</script>

<style lang="scss" scoped>
</style>